package com.zyg.service.impl;

import com.zyg.dao.ClazzMapper;
import com.zyg.pojo.Clazz;
import com.zyg.service.ClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("clazzService")
public class ClazzServiceImpl implements ClazzService {

    @Autowired
    private ClazzMapper clazzMapper;


    @Override
    public List<Clazz> findAll(Clazz clazz, int offset, int pageSize) {

        return clazzMapper.findAll(clazz,offset,pageSize);
    }

    @Override
    public int addClazz(Clazz clazz) {
        return clazzMapper.addClazz(clazz);
    }

    @Override
    public int deleteClazz(int id) {
        return clazzMapper.deleteClazz(id);
    }

    @Override
    public Clazz findClazzById(int id) {
        return clazzMapper.findClazzById(id);
    }

    @Override
    public int updateClazz(Clazz clazz) {
        return clazzMapper.updateClazz(clazz);
    }

    @Override
    public int count(Clazz clazz) {
        return clazzMapper.count(clazz);
    }

    @Override
    public boolean login(Clazz clazz) {

        return clazzMapper.login(clazz)>0;
    }

    @Override
    public Clazz findClazzByClazzName(String clazzname) {
        Clazz clazz = clazzMapper.findClazzByClazzName(clazzname);
        return clazz;
    }
}
